<template>
  <div name="Department">
    <div class="item-list">
      <div class="item" v-for="d in DepartmentList" :key="d.id">
        <div class="imgBox">
          <dsfimg :src="getImg(d)" :error-src="config.setting_img" />
        </div>
        <p>{{ d.name }}</p>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "Department",
  data() {
    return {
      DepartmentList: [],
    };
  },
  components: {},
  created() {
  },
	mounted() {
		this.getData();
	},
  methods: {
    getData() {
      this.$http
        .get("/iaiqsmde9fea569965ed56ab98ea0501752fe631902841e/deptRecommendList")
        .then(res => {
          if (res.code == 0) {
            this.DepartmentList = res.data;
          }
        })
        .catch(err => {
          console.log(err.message || "数据异常");
        });
    },
    getImg(d) {
      return require(`@/assets/imgs/pc/sindex/Department/${d.name}.png`);
      // return require(`@/assets/imgs/pc/sindex/Department/${d.name}.png`);
    },
  },
};
</script>
